const { app, BrowserWindow} = require('electron')
const isDev = require('electron-is-dev')
let mainWindow = null; // 声明打开的主窗口
// require('@electron/remote/main').initialize()


app.on('ready', () => {
  mainWindow = new BrowserWindow({
    width: 800,
    height: 800,
    webPreferences: {
      nodeIntegration: true,
      enableRemoteModule: true,
      contextIsolation: false,
    }
  })

  const urlLocation = isDev ? 'http://localhost:3000' : 'xxx'
  mainWindow.loadURL(urlLocation)
  // require('./main/memu.js');
  mainWindow.webContents.openDevTools()
  // mainWindow.loadFile('demo7.html') // 加载html页面
  


  // require('@electron/remote/main').enable(mainWindow.webContents);

  mainWindow.on('close', () => {
    mainWindow = null;
  })
})
